# { "data": {"name":"Login", "version":"v1"} }
type Login {
    nickname: String
};

# { "data": {"name":"Message", "version":"v1"} }
type Message {
    from:    String,
    content: MessageContent
};

# { "data": {"name":"MessageContent", "version":"v1"} }
type MessageContent {
    text: String
};

# { "service": {"name":"ChatService", "version":"v1"} }
type Service interface {
    say: rpc::Method[MessageContent,()],
    receive-messages: rpc::Method*[(),Message]
};
# { "data": {"name":"Argument", "version":"v1"} }
type Service@Argument Login;

export const ERR_KIND: String := 'kind';
export const ERR_NAME_IN_USE: String := 'name-in-use';

export const DefaultServerBackend: rpc::ServerBackend :=
    { rpc::ServerCleartext { network: 'tcp', addr: '127.0.0.1:8001' } };

export const DefaultClientBackend: rpc::ClientBackend :=
    { rpc::ClientCleartext { network: 'tcp', addr: '127.0.0.1:8001' } };


